In [1]:
import sys
import numpy as np
import pandas as pd
import seaborn as sns
sns.set_theme()
In [2]:
results_folder = 'mmvec_major_taxa_scrambled_1'
results_base_name = 'latent_dim_3_input_prior_1.00_output_prior_1.00_beta1_0.90_beta2_0.95'
In [3]:
table = pd.read_table(results_folder + '/' + results_base_name + '_ranks.txt', index_col=0)
table.head()
Out[3]:
Propionibacteriaceae Staphylococcus caprae or capitis Staphylococcus epidermidis Staphylococcus hominis Other Staphylococci Polyomavirus HPyV6 Polyomavirus HPyV7 Merkel Cell Polyomavirus Malasseziaceae Corynebacteriaceae Micrococcaceae Other families
featureid
X940001 0.030385 0.195576 0.445758 0.098116 -0.038128 0.110024 0.096592 0.224846 0.107593 0.190436 0.212981 0.253598
X940002 -0.030952 -0.049524 -0.063730 -0.052636 -0.025059 -0.050213 0.000735 -0.010614 -0.028183 -0.048677 -0.051594 -0.026199
X940005 -0.068787 0.051849 -0.149584 0.244480 0.030714 0.199537 0.081876 -0.019941 0.038696 0.040158 0.083170 0.004477
X940007 0.414870 0.474137 0.310297 0.606715 0.428299 0.590012 0.442074 0.366284 0.487615 0.444503 0.496156 0.417681
X940010 0.214173 0.559161 0.656579 0.715679 0.409365 0.613173 0.255437 0.322402 0.259179 0.617511 0.598442 0.375538
In [4]:
table['Selected'] = np.isin(table.index,
                            ['X940203', 'X940589', 'X940625', 'X940925', 'X940936', 'X942191',
                             'X942237', 'X950023', 'X950028', 'X950056', 'X950157', 'X950173',
                             'X950193', 'X950225', 'X950228', 'X950233', 'X950254', 'X950396',
                             'X950485', 'X950584', 'X950661', 'X950999', 'X960035', 'X960242',
                             'X960306', 'X960421', 'X960463', 'X960465', 'X960712', 'X960726',
                             'X960934', 'X961553', 'X961686', 'X970018', 'X970091', 'X970092',
                             'X970232', 'X970283', 'X970327', 'X970342', 'X970633', 'X970680']
                           )
table.sort_values('Selected', inplace=True)
sns.relplot(
    table,
    y='Propionibacteriaceae', x='Staphylococcus epidermidis', hue='Selected'
)
Out[4]:
<seaborn.axisgrid.FacetGrid at 0x7fc084ca14d0>
In [5]:
sns.pairplot(table, hue='Selected')
Out[5]:
<seaborn.axisgrid.PairGrid at 0x7fc0848733d0>
In [6]:
for i in table.columns[:-1]:
    sns.displot(table, x=i, hue='Selected', multiple='stack')